package com.xm.service.module.USER.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import com.xm.service.module.USER.po.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {

    @Select("select * from user where uid=#{uid} and password=#{password}")
    User queryByIdAndName(@Param("uid") int uid, @Param("password") String password);

    @Select("select uid from user where uname = #{uname}")
    User queryByName(@Param("uname")String uname);

    @Insert("insert into user (uname,password,email,age,gender) " +
            "VALUES (#{uname},#{password},#{email},#{age},#{gender});")
    int creatorUser( @Param("uname") String uname,@Param("password") String password,
                     @Param("email") String email,
                     @Param("age") int age,@Param("gender") String gender);

    @Select("select * from user where email=#{email}")
    User queryEmail(String email);


    @Select("select * from user where uname=#{uname}")
    User queryName(String uname);

//    Boolean Login(@RequestParam("uid") int uid, @RequestParam("password") String password);
}
